﻿<%@ Page Language="C#" MasterPageFile="~/CmsMaster.Master" AutoEventWireup="true" CodeBehind="UpdateContractor.aspx.cs" Inherits="ContractManagementSystem.Presentation.ProfileManagement.UpdateContractor" Title="Profile manager >>> Update Contractor" ValidateRequest="false"%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../../Styles/ClientStyle.css" rel="stylesheet" type="text/css" />

    <script type = "text/javascript" language = "javascript" src = "../../JavaScript/JsLibrary.js"></script>        
    <script type = "text/javascript" language = "javascript" src = "../../JavaScript/jquery.js"></script>
    <script type = "text/javascript" language = "javascript" src = "../../JavaScript/menu.js"></script>
            <!---validate form--->
    <link href="../../JavaScript/validationEngine/css/template.css" rel="stylesheet"
        type="text/css" />
    <link href="../../JavaScript/validationEngine/css/validationEngine.jquery.css" rel="stylesheet"
        type="text/css" />
    <script src="../../JavaScript/validationEngine/js/jquery-1.6.min.js" type="text/javascript"></script>   

    <script src="../../JavaScript/validationEngine/js/jquery.validationEngine-en.js"
        type="text/javascript"></script>

    <script src="../../JavaScript/validationEngine/js/jquery.validationEngine.js" type="text/javascript"></script>
    
    <script type="text/javascript">
        jQuery(document).ready(function() {
        jQuery("#aspnetForm").validationEngine();
        });
    </script>
    <!----------------->
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" runat="server">
    <div class="CPF">
        <h3 class="CPFtitle">
            
        </h3>
        <div class="CPFinput">
            <asp:Label ID="Label2" runat="server" CssClass="CPFInputLabel">ContractorId:</asp:Label>
            <asp:TextBox runat="server" ID="textContractorId" CssClass="CPFInputField" Width="200px" Enabled="false"></asp:TextBox>
        </div>

        <div class="CPFinput">
            <asp:Label ID="Label3" runat="server" CssClass="CPFInputLabel">User Name:</asp:Label>        
            <asp:TextBox runat="server" ID="textUserName" CssClass="CPFInputField"
                Width="200px" Enabled="False" />
        </div>

         <div class="CPFinput">
            <asp:Label ID="Label4" runat="server" CssClass="CPFInputLabel">FullName:</asp:Label>        
            <asp:TextBox runat="server" ID="textFullName" CssClass="CPFInputField"
                Width="200px" Enabled="False" />
        </div>

          <div class="CPFinput">
            <asp:Label ID="Label6" runat="server" CssClass="CPFInputLabel">Phone Number1:</asp:Label>
              <asp:TextBox runat="server" ID="textPhoneNumber1" CssClass="validate[required,custom[integer]] CPFInputField"
                Width="198px"></asp:TextBox>
        </div>

        <div class="CPFinput">
            <asp:Label ID="Label7" runat="server" CssClass="CPFInputLabel">Phone Number2:</asp:Label>
            <asp:TextBox runat="server" ID="textPhoneNumber2" CssClass="validate[required,custom[integer]] CPFInputField"
                Width="198px"></asp:TextBox>
        </div>

        <div class="CPFinput">
            <asp:Label ID="Label8" runat="server" CssClass="CPFInputLabel">Address:</asp:Label>
            <asp:TextBox runat="server" ID="textAddress" CssClass="validate[required] CPFInputField"
                Width="199px"></asp:TextBox>
        </div>

        
        <div class="CPFinput">
            <asp:Label ID="Label9" runat="server" CssClass="CPFInputLabel">Email:</asp:Label>
            <asp:TextBox runat="server" ID="textEmail" CssClass="validate[required,custom[email] CPFInputField" Width="198px"></asp:TextBox>
        </div>

        <div class="CPFinput">
            <asp:Label ID="Label10" runat="server" CssClass="CPFInputLabel">Branch:</asp:Label>
            <asp:TextBox runat="server" ID="textBranch" CssClass="CPFInputField"
                Width="198px"></asp:TextBox>
        </div>

        <div class="CPFinput">
            <asp:Label ID="Label11" runat="server" CssClass="CPFInputLabel">SortCode:</asp:Label>
            <asp:TextBox runat="server" ID="textSortCode" CssClass="CPFInputField"
                Width="198px"></asp:TextBox>
        </div>

        <div class="CPFinput">
            <asp:Label ID="Label12" runat="server" CssClass="CPFInputLabel" Visible="false"></asp:Label>
            <asp:Label ID="ResultMessage" runat="server" CssClass="Results"></asp:Label>
        </div>
        
        <div class="CPFDivButton">
            <asp:Button runat="server" ID="ButtonSave" Text="Save" CssClass="CPFButton1"
                Width="69px" onclick="ButtonSaveClick" />
            <asp:Button runat="server" ID="buttonReset" Text="Reset" CssClass="CPFButton1"
                Width="72px"  />
              
        </div>

    </div>
    
         <!-- Validate fields with javascript-->
<script language = "javascript" type = "text/javascript">
    function ValidateAllFields()
    {
        if
        (
         !IsEmptyTextField('<%=textFullName.ClientID%>', '<%=ResultMessage.ClientID%>', "FullName can not be empty.")
    	 && !IsEmptyTextField('<%=textEmail.ClientID%>', '<%=ResultMessage.ClientID%>', "Email can not be empty.")
    	 && !ValidEmail('<%=textEmail.ClientID%>', '<%=ResultMessage.ClientID%>', "Email not format.")
    	 && !IsEmptyTextField('<%=textPhoneNumber1.ClientID%>', '<%=ResultMessage.ClientID%>', "PhoneNumber1 can not be empty.")
    	 && !IsEmptyTextField('<%=textPhoneNumber2.ClientID%>', '<%=ResultMessage.ClientID%>', "PhoneNumber2 can not be empty.")
    	 && !IsEmptyTextField('<%=textAddress.ClientID%>', '<%=ResultMessage.ClientID%>', "Address can not be empty.")
    	 && !IsEmptyTextField('<%=textBranch.ClientID%>', '<%=ResultMessage.ClientID%>', "Branch can not be empty.")
    	 && !IsEmptyTextField('<%=textSortCode.ClientID%>', '<%=ResultMessage.ClientID%>', "SortCode can not be empty.")
        )
        {
            return true; // All is valid
        }
        else
        {
            return false; // One of all is not valid
        }
    }
</script>
</asp:Content>
